package com.example.admin;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2025/9/1 22:18
 **/
@SpringBootApplication
@ComponentScan(basePackages = {"com.example"})
@MapperScan(basePackages = {
        "com.example.link.mapper",
        "com.example.chat.mapper",
        "com.example.shop.mapper",
        "com.example.courier.mapper",
        "com.example.werewolf.mapper",
        "com.example.common.mapper",
        "com.example.permission.mapper"
})
public class AdminApplication implements CommandLineRunner {
    @Autowired
    private RequestMappingHandlerMapping handlerMapping;

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        handlerMapping.getHandlerMethods().forEach((info, handler) -> {
            System.out.println("Mapped: " + info);
        });
    }
}